package net.sourceforge.openforecast.models;

/** A naive forecasting model is a special case of the moving average forecasting model where the number of periods used
 * for smoothing is 1. Therefore, the forecast for a period, t, is simply the observed value for the previous period,
 * t-1.
 * <p>
 * Due to the simplistic nature of the naive forecasting model, it can only be used to forecast up to one period in the
 * future. It is not at all useful as a medium-long range forecasting tool.
 * <p>
 * This model really is a simplistic model, and is included partly for completeness and partly because of its
 * simplicity. It is unlikely that you'll want to use this model directly. Instead, consider using either the moving
 * average model, or the more general weighted moving average model with a higher (i.e. greater than 1) number of
 * periods, and possibly a different set of weights. */
public class NaiveForecastingModel extends MovingAverageModel {
	/** Constructs a new naive forecasting model. For a valid model to be constructed, you should call init and pass in
	 * a data set containing a series of data points with the time variable initialized to identify the independent
	 * variable. */
	public NaiveForecastingModel() {
		super(1);
	}

	/** Returns a one or two word name of this type of forecasting model. Keep this short. A longer description should
	 * be implemented in the toString method.
	 * 
	 * @return a string representation of the type of forecasting model implemented. */
	public String getForecastType() {
		return "Naive forecast";
	}

	/** This should be overridden to provide a textual description of the current forecasting model including, where
	 * possible, any derived parameters used.
	 * 
	 * @return a string representation of the current forecast model, and its parameters. */
	public String toString() {
		return "Naive forecasting model (i.e. moving average with a period of 1)"
				+ ", using an independent variable of " + getIndependentVariable() + ".";
	}
}